const {
  Sequelize,
  Model
} = require('sequelize')
const {
  sequelize
} = require('../config/db');


// 定义模型
class live extends Model {

}

// 初始模型
live.init({
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  uid: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '医生'
  },
  title: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '标题'
  },
  coverImage: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '封面'
  },
  introduction: {
    type: Sequelize.STRING,
    allowNull: true,
    comment: '介绍'
  },
  rtmp: {
    type: Sequelize.STRING,
    allowNull: true,
    comment: 'rtmp'
  },
  code: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '直播码'
  },
  status: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '开播状态'
  },
}, {
  sequelize,
  modelName: 'live',
  tableName: 'live'
})

// live.sync({
//   force: true
// })

module.exports = live

